package task03;

public class Market {
    private String MarketName;
    private  Product[]products;

  public String getMarketName() {
    return MarketName;
  }

  public void setMarketName(String marketName) {
    MarketName = marketName;
  }

  public Product[] getProducts() {
    return products;
  }

  public void setProducts(Product[] products) {
    this.products = products;
  }

  Product sell (Product P){
        for(int i=0;i<products.length;i++){
            if(products[i].getProductName()==P.getProductName()){
                return  products[i];
            }
        }
               return null;
    }
}
